package com.xinwei.shard.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ResultEnum {

    SUCCESS(200, "成功"),
    FAILURE(500,"失败"),

    INTERNAL_SERVER_ERROR(501,"程序内部异常"),
    REQUEST_PARAM_ERROR(502, "请求参数错误"),

    NULL_POINTER_EXCEPTION(601, "空指针异常"),
    BIZ_EXCEPTION(602, "数据不能为空"),
    TOKEN_EXCEPTION(603, "token不能为空");

    private final Integer code;
    private final String message;

    public static void main(String[] args) {
        ResultEnum[] resultEnums = ResultEnum.values();
        Arrays.asList(resultEnums).forEach(System.out::println);

    }

}
